using System;
using System.Collections;
using NetBpm.Workflow.Delegation;

using BEGDC.CC.BL.Email;
using BEGDC.Utility.Castle;
using BEGDC.CC.BL.Common;

namespace BEGDC.CC.BL.Workflow
{
	/// <summary>
	/// Summary description for CCEmailAction.
	/// </summary>
	public class CCEmailAction : IActionHandler
	{
		#region IActionHandler Members

		public void Run(IActionContext actionContext)
		{
			IDictionary configuration = actionContext.GetConfiguration();
			string template = (String) configuration["template"];
			long flowid = actionContext.GetFlow().Id;
			
			IEmail email = AppContainer.Instance[ServiceConst.EmailService] as IEmail;
			email.Send((long)flowid, template);
		}			

		#endregion
	}
}
